home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / INFO / DOSTRAIN.ZIP / MAKEFILE.BAS < prev    next >
BASIC Source File  |  1986-10-06  |  2KB  |  42 lines

  1. 10 CLS
  2. 20 KEY OFF
  3. 30 LOCATE 1,1,1
  4. 40 DIM F$(100)
  5. 50 PRINT"Okay, just start typing your file whenever you are ready."
  6. 60 PRINT "When you are finished, type CTRL-Q.": PRINT : PRINT
  7. 70 P=1
  8. 80 I$=INKEY$
  9. 90 IF I$="" THEN 80
  10. 100 IF ASC(I$)=8 THEN GOSUB 350: GOTO 80
  11. 110 IF LEN(I$)=2 AND ASC(RIGHT$(I$,1))=83 THEN GOSUB 350: GOTO 80
  12. 120 IF I$=CHR$(13) THEN PRINT: C=1: F$(P)=L$: P=P+1: L$="": GOTO 80
  13. 130 IF I$=CHR$(17) THEN GOTO 180
  14. 140 IF I$<CHR$(32) OR I$>CHR$(126) THEN BEEP: GOTO 80
  15. 150 IF LEN(I$)<>1 THEN BEEP: GOTO 80
  16. 160 IF C>65 THEN BEEP: GOTO 80
  17. 170 PRINT I$;:C=C+1: L$=L$+I$: GOTO 80
  18. 180 PRINT: PRINT
  19. 190 IF C<>1 THEN F$(P)=L$: P=P+1
  20. 192 PRINT "Okay, now I will save the text you have typed in a disk file.
  21. 194 INPUT "Which floppy disk drive do you want to save the file on? ", DR$
  22. 196 IF DR$<>"a" AND DR$<>"A" AND DR$<>"b" AND DR$<>"B" THEN PRINT "The drive should be A or B only!": GOTO 194
  23. 200 print
  24. 210 PRINT "Give me a file name consisting of no more than eight"
  25. 220 INPUT "characters: ", FLNAME$
  26. 230 IF LEN(FLNAME$) >8 OR LEN(FLNAME$) < 1 THEN PRINT: PRINT "DOS filenames must be between 1 and 8 characters!": PRINT: GOTO 200
  27. 240 PRINT
  28. 270 OPEN "o", #1, DR$+":"+FLNAME$
  29. 280 FOR I=1 TO P: PRINT#1 , F$(I): NEXT I
  30. 290 CLOSE
  31. 300 PRINT: PRINT "Your file has been saved on drive '";DR$;"' under the name '";FLNAME$;
  32. 310 PRINT "'.
  33. 320 PRINT "You can check that out using the DIR and TYPE commands."
  34. 330 PRINT
  35. 340 STOP
  36. 350 REM BACKSPACE
  37. 360 X=POS(0)
  38. 370 LOCATE ,X-1,1: PRINT " ";:LOCATE ,X-1,1: C=C-1
  39. 380 L$=LEFT$(L$,LEN(L$)-1)
  40. 390 IF C=0 THEN C=1
  41. 400 RETURN
  42.